<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'Demo.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
    <title>铁路运输订票界面</title>
  </head>
  
  <body style=background-image:url(18.jpg);>
   <center>
   <h1><font color="red">12593铁路运输用户订票界面</font></h1>
   <hr/>
   <br/>
   <br/>
   <%
   
   if(session.getAttribute("uname")!=null){
	   request.setCharacterEncoding("utf-8");
	   String seatn = request.getParameter("seatn");
	   String carr = request.getParameter("carr");
	   String tid = request.getParameter("tid");
   %>
    <form action="book" method="post" onsubmit="return login()">
    <table>
      <tr>
		<td colspan="2"><h1>请填写要购买车票的乘客信息</h1> </td>
	  </tr>
	  <tr>
        <td>乘客姓名</td>
        <td><input type="text" name="name"></td>
      </tr>
      <tr>
        <td>证件类型</td>
        <td><input type="text" name="pit" value="二代身份证"></td>
      </tr>
       <tr>
        <td>证件号码</td>
        <td><input type="text" name="pin"></td>
      </tr>
       <tr>
        <td>联系电话</td>
        <td><input type="text" name="phone"></td>
      </tr>
      <tr>
		<td colspan="2">
		    <input type="hidden" name="status" value="bticket">
		    <input type="hidden" name="carr" value=<%=request.getParameter("carr")%>>
		    <input type="hidden" name="tid" value=<%=request.getParameter("tid")%>>
		    <input type="hidden" name="seatn" value=<%=request.getParameter("seatn")%>>
			<input type="submit" value="预订">
		</td>
	  </tr>
	  <tr>
	     <td  colspan="2"><a href = "ticketInfo.jsp"><h1>返回车票查询</h1></a></td>
	  </tr>
    </table>
    </form>
    <%
    }else{
   	    response.setHeader("refresh","2;url=login.jsp");
    %>
   			  只有登陆后才能预订车票，请先登陆！！！<br>
   			  两秒后自动跳转到登陆窗口！！！<br>
   			  如果没有跳转，请点击<a href="login.jsp">这里</a>!!!<br>
   	<%
   	  }
   	%>
   </center>
  </body>
</html>
